﻿using Reticulum.Properties;
using Reticulum.User;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.Versioning;
using System.Text;
using System.Threading.Tasks;

namespace Reticulum.工具类
{
    class ImageShow
    {

        /* 编写人：蒙兰德
         * 时间：2020/7/15/8:22
         * 功能：显示用户的头像
         * 
         */
        public static Image IamgeShows()
        {
            //显示用户的头像
            if (ThisMyInfo.ImagePath != "")
            {
                FileInfo fileInfo = new FileInfo(ThisMyInfo.ImagePath);
                if (fileInfo.Exists)
                {
                    Image imagepath = Image.FromFile(ThisMyInfo.ImagePath);
                    return imagepath;
                }
            }
            return Resources.空头像;
        }

        public static Image OthersUserImage(string DML)
        {
            //显示用户的头像
            if (DML != "")
            {
                FileInfo fileInfo = new FileInfo(DML);
                if (fileInfo.Exists)
                {
                    Image imagepath = Image.FromFile(DML);
                    return imagepath;
                }
            }
            return Resources.空头像;
        }
    }
}
